import { getQueryObject, param } from '@/utils/searchParam'

// 获取路由参数
export const GetRouteParameters = (token: string) => {
	const locationHref: string = `https://auth-sit.igwfmc.test/auth/realms/sample-realm-1/protocol/openid-connect/auth?url={{{http://10.86.27.218:8001/web/productFlow/programReview/inputBaseInfo/index?planFlowId=425&fundRaiseType=1&baseCaseDocId=758175}}}`
	const SourceUrl: string = `${locationHref.split('{{{')[1].replaceAll("}}}", '')}` // 源地址
	let SourceAddress: any = getQueryObject(SourceUrl) // 源参数
	if (Object.keys(SourceAddress).length) {
		SourceAddress.token = token
	} else {
		SourceAddress = {
			token
		}
	}
	let url = `${SourceUrl.split('?')[0]}?${param(SourceAddress)}`
	location.href = url
}

